﻿namespace Pub.Class
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Reflection;
    using System.Runtime.InteropServices;

    public interface ISafeDictionary<K, V> : IEnumerable<KeyValuePair<K, V>>, IEnumerable
    {
        ISafeDictionary<K, V> Add(K key, V value);
        ISafeDictionary<K, V> AddOrUpdate(K key, V value);
        ISafeDictionary<K, V> Clear();
        bool ContainsKey(K key);
        V Get(K key, Func<V> acquire);
        bool Remove(K key);
        bool TryGetValue(K key, out V value);

        int Count { get; }

        V this[K key] { get; set; }

        ICollection<K> Keys { get; }

        ICollection<V> Values { get; }
    }
}

